<div class="row">
 <small>
 <div class="span3 bs-docs-sidebar ">
 	<*include file="<*$controller*>/location.tpl"*>
  </div>

  <div class="span8">
     <div class="clearfix txtleft search span8" style="background-color:#f8f8f8; padding:10px; margin:10px 0px;"> 
      <form action="/<*$controller*>/index" method="get"   name="form1" class="form-horizontal">       
                <select name="groupid" id="groupid" > 
                    <option value="">---选择机构---</option> 
                    <*foreach from =$group item=a key=k*>
                    <option value="<*$k*>" <*if $groupid==$k*> selected<*/if*>><*$a*></option> 
                    <*/foreach*>
                </select>
          		<input type="text" class="span2 input-xlarge" placeholder="请输入学校姓名关键字"  name="keyword" id="keyword" value="<*$keyword*>" >
         		<input type="submit" class="btn btn-success"  value="查询"  >
         		<div style="float:right; margin-right:20px;"><input type="button" class="btn btn-success" value="购买服务" onclick="window.location='/<*$controller*>/buyview'" ></div>
      </form>

	</div>	    

<table class="table">
<tr><td colspan="10"><*$page*></td></tr>
<tr>
<th>机构名称</th>
<th>学校名称</th>
<th>已购服务</th>
<th>学生配额</th>
<th>操作</th>
<th>&nbsp;</th>
</tr>
   <*foreach from=$school item=item key=key name=foo*>
   <*eval var=$item.groupid assign="groupid"*>
   <*if $item.service*>
   <*foreach from=$item.service item=a key=k *>
   <tr>
   <td><*$group.$groupid*></td>
   <td><*$item.schoolname*></td>
   <td><*$a.productname*>&nbsp;<*$a.start_time|date_format:"%Y-%m-%d" *>~<*$a.end_time|date_format:"%Y-%m-%d" *><*if $a.isopen_chunyu*>(含春雨)<*/if*></td>
   <td><*$a.studentnum*></td>
   <td><*if $a.productid eq 1*><a style="cursor:pointer" title="增加配额" onClick="addview('<*$key*>','<*$a.school_orderid*>')" >增加配额</a><*/if*></td>
   <td>&nbsp;</td>
   </tr>
   <*/foreach*>
   <*else*>
   <tr>
   <td><*$group.$groupid*></td>
   <td><*$item.schoolname*></td>
   <td>无</td>
   <td></td>
   <td><a style="cursor:pointer" title="购买服务" onClick="buyview('<*$key*>','<*$groupid*>')" >购买服务</a></td>
   <td>&nbsp;</td>
   </tr>
   <*/if*>
  <*/foreach*>
<tr><td colspan="10"><*$page*></td></tr>
</table>
</div>
</div> 
<script type="text/javascript"> 
function buyview(sid,gid){
   window.location='/<*$controller*>/buyview/sid/'+sid+'/gid/'+gid;   
}  		 	  
function addview(sid,orderid){
   window.location='/<*$controller*>/addview/sid/'+sid+'/orderid/'+orderid;   
}  		 	  
</script>

</div>